package com.eh.factory.simpleFactory.factory;

import com.eh.factory.simpleFactory.pizza.ClamPizza;
import com.eh.factory.simpleFactory.pizza.CheesePizza;
import com.eh.factory.simpleFactory.pizza.Pizza;
import com.eh.factory.simpleFactory.pizza.VeggiePizza;

/**
 * Created by David on 2016/4/26.
 */
public class SimplePizzaFactory {
    public static Pizza createPizza(String type) {
        Pizza pizza = null;
        if ("cheese".equals(type)) {
            pizza = new CheesePizza();
        } else if ("calm".equals(type)) {
            pizza = new ClamPizza();
        } else if ("veggie".equals(type)) {
            pizza = new VeggiePizza();
        }
        return pizza;
    }
}
